Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Chart for limits set to vizualise limits distribution #2589

Merged
merged 38 commits into from
Feb 26, 2025

Conversation

basseche
Copy link
Contributor

No description provided.

github-actions[bot]

This comment was marked as outdated.

…bution of limits

Signed-off-by: basseche <bassel.el-cheikh_externe@rte-france.com>
@basseche basseche force-pushed the graphique_LimitSets branch from a644124 to 79113c7 Compare February 17, 2025 09:41
@gridsuite gridsuite deleted a comment from github-actions bot Feb 17, 2025
@basseche basseche self-assigned this Feb 17, 2025
@gridsuite gridsuite deleted a comment from sonarqubecloud bot Feb 17, 2025
@basseche basseche requested a review from thangqp February 18, 2025 13:35
@basseche basseche changed the title WIP : graph limitset Add Chart for limits set to vizualise limits distribution Feb 18, 2025
Mathieu-Deharbe

This comment was marked as off-topic.

@Mathieu-Deharbe Mathieu-Deharbe self-requested a review February 18, 2025 16:14
Mathieu-Deharbe

This comment was marked as resolved.

Mathieu-Deharbe

This comment was marked as resolved.

@Mathieu-Deharbe Mathieu-Deharbe self-requested a review February 19, 2025 16:15
@etiennehomer
Copy link
Contributor

I don't have the skills to analyse the changes you made in the dependencies but many things are updated. @etiennehomer is that ok ?

Yes it's ok. The changes come from the transitive dependances (https://www.npmjs.com/package/@mui/x-charts?activeTab=dependencies) and the package-lock.json is not changed after I did npm install again.

Copy link

@basseche basseche merged commit 0a5f5d3 into main Feb 26, 2025
5 checks passed
@basseche basseche deleted the graphique_LimitSets branch February 26, 2025 16:30
export interface LimitsGraphProps {
limitsGroupFormName: string;
}
const colorIST = '#58d058';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems an abbreviation in french, in general, abbreviation is not encouraged to use in code

// threshold with biggest tempo and biggest value than the previous threshold
// more than one threshold without value
const isPermanentLimit =
(item.name === intl.formatMessage({ id: 'IST' }) && currentLimits.permanentLimit) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to avoid using compare with formatted name, but can do later

return thresholds.reduce<{ series: BarSeriesType[]; ticks: Ticks[] }>(
(acc, item, index) => {
const isPermanentLimit =
(item.name === intl.formatMessage({ id: 'IST' }) && currentLimits.permanentLimit) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to avoid using compare with formatted name, but can do later

Comment on lines +115 to +129
thresholds.sort((a, b) => {
if (a.value && !b.value) {
return -1;
}
if (!a.value && !b.value && a.acceptableDuration && b.acceptableDuration) {
return a.acceptableDuration - b.acceptableDuration;
}
if (!a.value && b.value) {
return 1;
}
if (a.value && b.value) {
return a.value - b.value;
}
return 0;
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To extract outside of component

Comment on lines +207 to +210
const config = {
id: 'topAxis',
valueFormatter: (value: number, context: AxisValueFormatterContext) =>
ticks.find((item: Ticks) => item.position === value)?.label,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can extract config outside of component

Comment on lines +19 to +21
const colorPermanentLimit = '#58d058';
const colors: string[] = ['#ffc019', '#e47400', '#cc5500', '#ff5757', '#ff0000'];
const colorForbidden: string = '#b10303';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to see with Stephan whether using mui palette colors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants